package org.jmc.refmanager.web.wicket.page.validation;

import org.apache.wicket.PageParameters;
import org.apache.wicket.feedback.ComponentFeedbackMessageFilter;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.jmc.refmanager.web.wicket.form.TaskViewForm;
import org.jmc.refmanager.web.wicket.model.ChangeModel;
import org.jmc.refmanager.web.wicket.page.template.TemplatePage;

/**
 */
public class TaskViewPage extends TemplatePage {

	/**
	 * @param parameters
	 */
	public TaskViewPage(PageParameters parameters) {
		super(parameters);
		initComponents(parameters);
	}

	private void initComponents(final PageParameters parameters) {
		add(new Label("pageTitle", "Détail du changement"));

		final Integer taskId = parameters.getAsInteger("id");
		
		TaskViewForm viewForm = new TaskViewForm("viewForm", new ChangeModel(taskId));
		add(viewForm);

		final FeedbackPanel feedback = new FeedbackPanel("feedback",
				new ComponentFeedbackMessageFilter(viewForm));
		feedback.setOutputMarkupId(true);
		add(feedback);
	}

}

